import 'package:high_help_apps/common/entities/misc/schools/majors_request_entity.dart';
import 'package:high_help_apps/common/entities/misc/schools/majors_response_entity.dart';
import 'package:high_help_apps/common/entities/misc/schools/schools_response_entity.dart';
import 'package:high_help_apps/common/utils/http.dart';

/// FileName: school
/// Author: admin
/// Date: 2021-07-30 21:40
/// Description:

class SchoolAPI {

  /// 获取所有的学校
  static Future getAllSchools() async {

    var response = await HttpUtil().get(
        '/school/schools'
    );
    return SchoolsResponseEntity().fromJson(response);
  }

  /// 获取所有的专业
  static Future getMajorBySchool({
    MajorsRequestEntity? params
}) async {
    var response = await HttpUtil().get(
        '/school/major',
      queryParameters: params?.toJson()
    );

    return MajorsResponseEntity().fromJson(response);
  }

}

